<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="simple" uri="MySimpleTag" %>
<%--
  Created by IntelliJ IDEA.
  User: 秋与月
  Date: 2022/11/30
  Time: 14:02
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML>
<html lang="zh-cn">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>管理管理员</title>

    <link href="<c:url value="/plugins/bootstrap-3.3.0/css/bootstrap.min.css"/>" rel="stylesheet"/>
    <link href="<c:url value="/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css"/>" rel="stylesheet"/>
    <link href="<c:url value="/plugins/bootstrap-table-1.11.0/bootstrap-table.min.css"/>" rel="stylesheet"/>
    <link href="<c:url value="/plugins/waves-0.7.5/waves.min.css"/>" rel="stylesheet"/>
    <link href="<c:url value="/plugins/jquery-confirm/jquery-confirm.min.css"/>" rel="stylesheet"/>
    <link href="<c:url value="/plugins/select2/css/select2.min.css"/>" rel="stylesheet"/>
    <link href="<c:url value="/css/common.css"/>" rel="stylesheet"/>

</head>
<body onload="checkForm()">
<div id="main">

    <c:if  test="${ manager.isSuper == 1}">
    <div id="toolbar">
        <a class="waves-effect waves-button" href="javascript:;" onclick="createAction()"><i class="zmdi zmdi-plus"></i> 新增管理员</a>
    </div>
        <table id="table" ></table>
    </c:if>

</div>

<h3>&nbsp; &nbsp; <simple:isSuper username="${manager.username}" types="${manager.isSuper}"/></h3>


<!-- 新增 -->
<div id="createDialog" class="crudDialog" hidden>
    <form  action="/manager/managers/add" method="get"  id="form1">
        <div class="form-group">
            <label for="input1">用户名</label>
            <input id="input1" type="text" class="form-control" name="username">
        </div>
        <div class="form-group">
            <label for="input2">密码</label>
            <input id="input2" type="text" class="form-control" name="password">
        </div>
        <div class="form-group">
            <label for="input3">性别(男/女)</label>
            <input id="input3" type="text" class="form-control" name="sex">
        </div>


        <div class="form-group">
            <label for="input4">电话</label>
            <input id="input4" type="text" class="form-control" name="phonenumber">
        </div>

        <div class="form-group">
            <label for="input6">邮箱</label>
            <input id="input6" type="text" class="form-control" name="email">
        </div>

        <div class="form-group">
            <label for="input7">权限(超级管理员/普通管理员)</label>
            <input id="input7" type="text" class="form-control" name="remark">
        </div>

        <input type="submit" class="button1" value="提交" >

    </form>
</div>

<div id="createDialog2" class="crudDialog" hidden>
    <form  action="/manager/managers/edit" method="post"  id="form2">
        <div class="form-group">
            <label for="input11"></label>
            <input id="input11" type="text" class="form-control" name="username" disabled>
        </div>
        <div class="form-group">
            <label for="input22"></label>
            <input id="input22" type="text" class="form-control" name="password">
        </div>
        <div class="form-group">
            <label for="input33"></label>
            <input id="input33" type="text" class="form-control" name="sex">
        </div>

        <div class="form-group">
            <label for="input44"></label>
            <input id="input44" type="text" class="form-control" name="phonenumber">
        </div>

        <div class="form-group">
            <label for="input66"></label>
            <input id="input66" type="text" class="form-control" name="email">
        </div>

        <div class="form-group">
            <label for="input77"></label>
            <input id="input77" type="text" class="form-control" name="remark">
        </div>

        <input type="submit" class="button1" value="提交" >

    </form>
</div>
<script type="text/javascript">
    function checkForm() {
        var flag = '<%=request.getAttribute("message")%>';
        if(flag !== "null") {
            alert(flag);
        }
    }
</script>
<script src="<c:url value="/plugins/jquery.1.12.4.min.js"/>"></script>
<script src="<c:url value="/plugins/bootstrap-3.3.0/js/bootstrap.min.js"/>"></script>
<script src="<c:url value="/plugins/bootstrap-table-1.11.0/bootstrap-table.min.js"/>"></script>
<script src="<c:url value="/plugins/bootstrap-table-1.11.0/locale/bootstrap-table-zh-CN.min.js"/>"></script>
<script src="<c:url value="/plugins/waves-0.7.5/waves.min.js"/>"></script>
<script src="<c:url value="/plugins/jquery-confirm/jquery-confirm.min.js"/>"></script>
<script src="<c:url value="/plugins/select2/js/select2.min.js"/>"></script>

<script src="<c:url value="/js/common.js"/>"></script>
<script src="<c:url value="/js/admin3.js"/>"></script>

</body>
</html>
